You are here: Understanding the Meridian event procedures > About the property page events > <PageName>Page_CanApply event

NEW  <PageName>Page_CanApply event

Occurs when a user clicks Apply or Close in the Meridian client applications for one of the pages listed in NEW About the property page events except for the Document and Folder pages (not editable). This event occurs once for every changed property value. If this event returns False, the corresponding grid cell on the Title Blocks property page is switched to edit mode and will wait for the user to modify the current value.

Syntax

<PageName>Page_CanApply(Context) As Boolean
Parameters
Name Description

Context

A one dimension array that contains the layout name, block name, property name, old value, and new value as shown in the example. Read only.

Remarks

Use this event to validate the property values that are mapped to attributes in the title blocks in multiple layouts of a drawing. The name of the event for the Title Blocks page is TitleBlocksPage_CanApply (no spaces). The DocGenericEvent_OnProperties event occurs after this event.

Example

Function TitleBlocksPage_CanApply(Context)
    If Not Document Is Nothing Then
        If IsArray(Context) Then
            Dim s
            s = "Layout = " + CStr(Context(0)) + ", "
            s = s + "Block = " + CStr(Context(1)) + ", "
            s = s + "Property = " + CStr(Context(2)) + ", "
            s = s + "Old value = " + CStr(Context(3)) + ", "
            s = s + "New value = " + CStr(Context(4))
            If UCase(CStr(Context(4))) = LCase(CStr(Context(4))) Then
                TitleBlocksPage_CanApply = True
                s = s + ": VALID"
            Else
                TitleBlocksPage_CanApply = False
                s = s + ": INVALID"
            End If
            WinMsgBox s
        End If
     End If
 End Function

www.bluecieloecm.com